/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package com.plian.system.service.qg.guarantee;

import com.plian.Tools.pagedata.PageData;
import com.plian.system.dto.qg.guarantee.PropertyGuaranteeApplyDTO;
import com.plian.system.entity.qg.guarantee.PropertyGuaranteeApply;
import com.plian.system.entity.qg.guarantee.PropertyGuaranteeExecute;
import com.plian.system.mybatis.base.BaseService;
import com.plian.system.vo.report.ReportReturnVO;

/**
 * 企业担保申请主表 服务类
 *
 * @author jianglei
 * @since 2019-10-23
 */
public interface IPropertyGuaranteeApplyService extends BaseService<PropertyGuaranteeApply> {

	/**
	 * 校验编码
	 *
	 * @param id
	 * @param code
	 * @return
	 */
	Boolean checkIsExisted(Long id, String code);

	/**
	 * 保存或新增,包含子表
	 *
	 * @param propertyGuaranteeApply
	 * @return
	 */
	Boolean submit(PropertyGuaranteeApply propertyGuaranteeApply);


	/**
	 * 用于申请担保单位汇总表
	 *
	 * @param propertyGuaranteeApplyDTO
	 * @return
	 */
	ReportReturnVO guaranteeUnitSummary(PropertyGuaranteeApplyDTO propertyGuaranteeApplyDTO) throws Exception;


	/**
	 * 用于担保人汇总表
	 *
	 * @param propertyGuaranteeApplyDTO
	 * @return
	 */
	ReportReturnVO guaranteeSummary(PropertyGuaranteeApplyDTO propertyGuaranteeApplyDTO) throws Exception;

	/**
	 * 用于被担保人汇总表
	 *
	 * @param propertyGuaranteeApplyDTO
	 * @return
	 */
	ReportReturnVO warranteeSummary(PropertyGuaranteeApplyDTO propertyGuaranteeApplyDTO) throws Exception;


	/**
	 * 担保项目及年度对比分析
	 *
	 * @param propertyGuaranteeApplyDTO
	 * @return
	 */
	ReportReturnVO guaranteeAnnualAnalysis(PropertyGuaranteeApplyDTO propertyGuaranteeApplyDTO);

	/**
	 * 校验是否能取消审核和变更
	 *
	 * @param id
	 * @return
	 */
	Boolean checkCancel(Long id);

	/**
	 * 校验执行数据是否超过剩余，没有则修改担保信息
	 *
	 * @param id  担保主键
	 * @param old 旧的执行信息
	 * @param now 现在的执行信息
	 * @return
	 */
	String checkExecute(Long id, PropertyGuaranteeExecute old, PropertyGuaranteeExecute now);

	PageData guaranteeDateAnalysis(PropertyGuaranteeApplyDTO propertyGuaranteeApplyDTO);

	PageData guaranteeAmountTotalAnalysis(PropertyGuaranteeApplyDTO propertyGuaranteeApplyDTO);

    PageData unitRankIdAnalysis(PropertyGuaranteeApplyDTO propertyGuaranteeApplyDTO);

	PageData guaranteeModeIdAnalysis(PropertyGuaranteeApplyDTO propertyGuaranteeApplyDTO);

	String saveGuaranteeApplyList(String data);
}
